/*v-assignment-if ="{link:'submenu/query/page'}"*/
var userInfo = getCurrentUserInfo();
var operate_urls = [];

if(userInfo){
	operate_urls = userInfo.menuUrls;
}else{
	top.location.href="login.html";
}

var checkAssugnment = function(code) {
	var index = -1;
	index = $.inArray(code, operate_urls);
	return index==-1?false:true;
}

Vue.directive('assignment-if', {
	 inserted: function (el, binding) {
		var arg = binding.value.link;
		if(arg && el) {
			if(!checkAssugnment(arg)){
				$(el).remove();
			}
		} else {
			console.warn("权限判断内容缺失:"+JSON.stringify(arg));
		}
	}
});
